﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <SnippetTypes>
        <SnippetType>Expansion</SnippetType>
      </SnippetTypes>
      <Title>INPC Property</Title>
      <Author>Laurent Bugnion (GalaSoft)</Author>
      <Description>A property raising PropertyChanged with a lambda. The class using this property should inherit GalaSoft.MvvmLight.ObservableObject. (V4.0.21.0)</Description>
      <HelpUrl>http://www.galasoft.ch/mvvm</HelpUrl>
      <Shortcut>mvvminpclambda</Shortcut>
    </Header>
    <Snippet>
    <Declarations>
        <Literal Editable="true">
          <ID>Type</ID>
          <ToolTip>Property type</ToolTip>
          <Default>Boolean</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>AttributeName</ID>
          <ToolTip>Attribute name</ToolTip>
          <Default>_myProperty</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>InitialValue</ID>
          <ToolTip>Initial value</ToolTip>
          <Default>False</Default>
          <Function>
          </Function>
        </Literal>
        <Literal Editable="true">
          <ID>PropertyName</ID>
          <ToolTip>Property name</ToolTip>
          <Default>MyProperty</Default>
          <Function>
          </Function>
        </Literal>
      </Declarations>
      <Code Language="vb"><![CDATA[''' <summary>
        ''' The <see cref="$PropertyName$" /> property's name.
        ''' </summary>
        Public Const $PropertyName$PropertyName As String = "$PropertyName$"
        
		Private $AttributeName$ As $Type$ = $InitialValue$

        ''' <summary>
        ''' Sets and gets the $PropertyName$ property.
        ''' Changes to that property's value raise the PropertyChanged event. 
        ''' </summary>
		Public Property $PropertyName$ As $Type$
            Get            
                return $AttributeName$
            End Get
            Set            
                if $AttributeName$ = value Then Return                

                RaisePropertyChanging(Function() $PropertyName$PropertyName)
                $AttributeName$ = value
                RaisePropertyChanged(Function() $PropertyName$PropertyName)
            End Set
        End Property]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>